home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / getrusage.man < prev    next >
Encoding:
Text File  |  1989-04-03  |  5.8 KB  |  199 lines

  1.  
  2.  
  3.  
  4. GETRUSAGE             C Library Procedures              GETRUSAGE
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      getrusage - get information about resource utilization
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ttiimmee..hh>>
  13.      ##iinncclluuddee <<ssyyss//rreessoouurrccee..hh>>
  14.  
  15.      ##ddeeffiinnee RRUUSSAAGGEE__SSEELLFF      00         //** ccaalllliinngg pprroocceessss **//
  16.      ##ddeeffiinnee RRUUSSAAGGEE__CCHHIILLDDRREENN  --11        //** tteerrmmiinnaatteedd cchhiilldd pprroocceesssseess **//
  17.  
  18.      ggeettrruussaaggee((wwhhoo,, rruussaaggee))
  19.      iinntt wwhhoo;;
  20.      ssttrruucctt rruussaaggee **rruussaaggee;;
  21.  
  22. DDEESSCCRRIIPPTTIIOONN
  23.      _G_e_t_r_u_s_a_g_e returns information describing the resources util-
  24.      ized by the current process, or all its terminated child
  25.      processes.  The _w_h_o parameter is one of RUSAGE_SELF or
  26.      RUSAGE_CHILDREN.  The buffer to which _r_u_s_a_g_e points will be
  27.      filled in with the following structure:
  28.  
  29.           struct  rusage {
  30.                   struct timeval ru_utime;        /* user time used */
  31.                   struct timeval ru_stime;        /* system time used */
  32.                   int     ru_maxrss;
  33.                   int     ru_ixrss;               /* integral shared text memory size */
  34.                   int     ru_idrss;               /* integral unshared data size */
  35.                   int     ru_isrss;               /* integral unshared stack size */
  36.                   int     ru_minflt;              /* page reclaims */
  37.                   int     ru_majflt;              /* page faults */
  38.                   int     ru_nswap;               /* swaps */
  39.                   int     ru_inblock;             /* block input operations */
  40.                   int     ru_oublock;             /* block output operations */
  41.                   int     ru_msgsnd;              /* messages sent */
  42.                   int     ru_msgrcv;              /* messages received */
  43.                   int     ru_nsignals;            /* signals received */
  44.                   int     ru_nvcsw;               /* voluntary context switches */
  45.                   int     ru_nivcsw;              /* involuntary context switches */
  46.           };
  47.  
  48.      The fields are interpreted as follows:
  49.  
  50.      ru_utime       the total amount of time spent executing in
  51.                     user mode.
  52.  
  53.      ru_stime       the total amount of time spent in the system
  54.                     executing on behalf of the process(es).
  55.  
  56.      ru_maxrss      the maximum resident set size utilized (in
  57.                     kilobytes).
  58.  
  59.      ru_ixrss       an "integral" value indicating the amount of
  60.  
  61.  
  62.  
  63. Sprite v1.0               April 3, 1987                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GETRUSAGE             C Library Procedures              GETRUSAGE
  71.  
  72.  
  73.  
  74.                     memory used by the text segment that was also
  75.                     shared among other processes.  This value is
  76.                     expressed in units of kilobytes * ticks-of-
  77.                     execution.
  78.  
  79.      ru_idrss       an integral value of the amount of unshared
  80.                     memory residing in the data segment of a pro-
  81.                     cess (expressed in units of kilobytes *
  82.                     ticks-of-execution).
  83.  
  84.      ru_isrss       an integral value of the amount of unshared
  85.                     memory residing in the stack segment of a
  86.                     process (expressed in units of kilobytes *
  87.                     ticks-of-execution).
  88.  
  89.      ru_minflt      the number of page faults serviced without
  90.                     any I/O activity; here I/O activity is
  91.                     avoided by "reclaiming" a page frame from the
  92.                     list of pages awaiting reallocation.
  93.  
  94.      ru_majflt      the number of page faults serviced that
  95.                     required I/O activity.
  96.  
  97.      ru_nswap       the number of times a process was "swapped"
  98.                     out of main memory.
  99.  
  100.      ru_inblock     the number of times the file system had to
  101.                     perform input.
  102.  
  103.      ru_oublock     the number of times the file system had to
  104.                     perform output.
  105.  
  106.      ru_msgsnd      the number of IPC messages sent.
  107.  
  108.      ru_msgrcv      the number of IPC messages received.
  109.  
  110.      ru_nsignals    the number of signals delivered.
  111.  
  112.      ru_nvcsw       the number of times a context switch resulted
  113.                     due to a process voluntarily giving up the
  114.                     processor before its time slice was completed
  115.                     (usually to await availability of a
  116.                     resource).
  117.  
  118.      ru_nivcsw      the number of times a context switch resulted
  119.                     due to a higher priority process becoming
  120.                     runnable or because the current process
  121.                     exceeded its time slice.
  122.  
  123. NNOOTTEESS
  124.      The numbers _r_u__i_n_b_l_o_c_k and _r_u__o_u_b_l_o_c_k account only for real
  125.      I/O; data supplied by the caching mechanism is charged only
  126.  
  127.  
  128.  
  129. Sprite v1.0               April 3, 1987                         2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GETRUSAGE             C Library Procedures              GETRUSAGE
  137.  
  138.  
  139.  
  140.      to the first process to read or write the data.
  141.  
  142. EERRRROORRSS
  143.      The possible errors for _g_e_t_r_u_s_a_g_e are:
  144.  
  145.      [EINVAL]       The _w_h_o parameter is not a valid value.
  146.  
  147.      [EFAULT]       The address specified by the _r_u_s_a_g_e parameter
  148.                     is not in a valid part of the process address
  149.                     space.
  150.  
  151. SSEEEE AALLSSOO
  152.      gettimeofday(2), wait(2)
  153.  
  154. BBUUGGSS
  155.      There is no way to obtain information about a child process
  156.      that has not yet terminated.
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0               April 3, 1987                         3
  196.  
  197.  
  198.  
  199.